# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=crane
pkgver=0.17.0
pkgrel=0
pkgdesc="tool for interacting with remote images and registries"
url="https://github.com/google/go-containerregistry/tree/main/cmd/crane"
arch="all"
license="Apache-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/google/go-containerregistry/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/go-containerregistry-$pkgver/"

export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	msg "Building crane"
	go build ./cmd/crane/
}

check() {
	go test -v ./cmd/crane
}

package() {
	install -Dm0755 crane -t "$pkgdir"/usr/bin/
}

sha512sums="
8ec4b6da83aeb4a5aee13c5cf11949b3c2d4074289d0bafaa520c9738b69906183a208d73c42bbe6f3c0868dbd58ece675b65056959cd40870795848f3db1c54  crane-0.17.0.tar.gz
"
